import http from '../axios'

export function tologin(data){
    return http.request({
        url:'/login/userInfo',
        method:'post',
        data:data
    })
}

export function addCustomer(data){
    return http.request({
        url:'/login/addUser',
        method:'post',
        data:data
    })
}

export function getUserList(){
    return http.request({
        url:'/login/getUserList',
        method:'get',
    })
}

export function changeIdentify(data){
    return http.request({
        url:'/login/changeIdentify',
        method:'post',
        data:data
    })
}
// 删除用户
export function deleteUser(data){
    return http.request({
        url:'/login/deleteUser',
        method:'post',
        data:data
    })
}
// 获取全部的路由列表
export function getRouterList(){
    return http.request({
        url:'/login/getRouterList',
        method:'get',
    })
}

export function addRouter(data){
    return http.request({
        url:'/login/addRouter',
        method:'post',
        data:data
    })
}


// userIdentify  每种权限对应的路由列表
export function getIdentifyList(data){
    return http.request({
        url:'/login/getIdentifyList',
        method:'post',
        data:data
    })
}

export function updateIdentifyList(data){
    return http.request({
        url:'/login/updateIdentifyList',
        method:'post',
        data:data
    })
}

export function updateIdentifyRouter(data){
    return http.request({
        url:'/login/updateIdentifyRouter',
        method:'post',
        data:data
    })
}   

// 添加登录日志
export function addLoginLog(data){
    return http.request({
        url:'/login/addLoginLog',
        method:'post',
        data:data
    })
}

export function getLoginLog(params){
    return http.request({
        url:'/login/getLoginLog',
        method:'get',
        params:params
    })
}